package panel.mapPanel
{
	import assists.Lang;
	import assists.URI;
	import assists.resource.ResourceLoader;
	
	import flash.display.Sprite;
	import flash.display.Stage;
	
	import inerface.IShowLocationPanel;
	
	import main.ClientConstants;
	
	public class ShowLocationPanel extends Sprite implements IShowLocationPanel
	{
		private var _stage:Stage;
		private var _loader:ResourceLoader;
		private var _lang:Lang;
		private var _uri:URI;
		
		private var mapContainer:MapContainer;
		
		public function ShowLocationPanel()
		{
			super();
		}
		
		public function changeData(obj:*):void
		{
			if(!mapContainer){
				
				mapContainer = new MapContainer(_stage,_loader,_lang,_uri);
				mapContainer.initThis(_stage.stageWidth,_stage.stageHeight * .82);
				this.addChild(mapContainer);
				mapContainer.changeData([obj]);
				mapContainer.y = _stage.stageHeight * ClientConstants.HOME_UP_PER;
			}
		}
		
		public function init(stage:Stage, loader:ResourceLoader, lang:Lang, uri:URI=null):void
		{
			_stage = stage;
			_loader = loader;
			_lang = lang;
			_uri = uri;
		}
		
		public function clear():void
		{
			if(mapContainer){
				mapContainer.clear();
				mapContainer = null;
			}
		}
	}
}